import App from "./App";

// #ifndef VUE3
import Vue from "vue";
import "./uni.promisify.adaptor";
import uView from "@/uni_modules/uview-ui";

import mixinsConfig from "@/mixins/config.js";
// #ifdef MP-WEIXIN
import share from "@/mixins/share.js"; // 导入并挂载全局的分享方法
// #endif

import store from "@/store";
import common_function from "@/common/common_function.js";
import request from "@/common/request.js";
import config from "@/config.js";

import emptydata from "@/components/emptydata";

// 全局组件
Vue.component("emptydata", emptydata);

// 全局混入
// #ifdef MP
Vue.mixin(mixinsConfig); // 混入用于在组件中可使用
// #endif

// #ifdef MP-WEIXIN
Vue.mixin(share); // 全局分享
// #endif

Vue.use(uView);

Vue.prototype.$utils = common_function;
Vue.prototype.$request = request;
Vue.prototype.$store = store;

Vue.prototype.$config = config;

Vue.config.productionTip = false;
App.mpType = "app";
const app = new Vue({
  ...App,
});
app.$mount();
// #endif

// #ifdef VUE3
import { createSSRApp } from "vue";
export function createApp() {
  const app = createSSRApp(App);
  return {
    app,
  };
}
// #endif
